<template>
  <div>
    <el-tag
      v-for="(item, index) in renderRow.noticeWay"
      :key="index"
      v-if="renderField.prop === 'noticeWay'"
      >{{
        state.statusDict[renderField.prop as any][renderRow.noticeWay[index]]
      }}</el-tag
    >
    <el-tag v-if="renderField.prop === 'noticeType'">{{
      state.statusDict[renderField.prop as any][renderRow.noticeType]
    }}</el-tag>
  </div>
</template>
<script lang="ts" setup>
import { onMounted, reactive, inject } from "vue";
import type { TableColumn, TableRow, OptButton } from "@/utils/baTable"; //表格列行类型

const noticeConfig = inject("noticeConfig") as any;

// BuildAdmin将自动为此组件传递五个Props
interface Props {
  renderValue: any; // 单元格值
  renderRow: TableRow; // 当前行数据
  renderField: TableColumn; // 当前列数据
}

const props = withDefaults(defineProps<Props>(), {});

const state: { statusDict: any } = reactive({
  statusDict: noticeConfig.tags,
});

onMounted(() => {
  console.log(
    "TagVue单元格值",
    noticeConfig.tags,
    props.renderRow.noticeWay[0]
  );
});
</script>
<style lang="scss" scoped></style>
